package DistSys;

import DistSys.SysConst;

public class ShadingOption {

    private String sDescription = null;
    //private SysConst.MappedIndex mSource = null;
    private int     iIndex = -1;
    private boolean bIsResult = true;
    private boolean bContinuous = false;
    private boolean bAutoScale = true;
    private double  dPercentBelow = 0.0;
    private double  dPercentAbove = 5.0;
    private double  dStart = 0.0;
    private double  dEnd = 4.0;

    public ShadingOption() {
        sDescription = "";
        //mSource = new SysConst.MappedIndex(-1, -1);
    }
    public ShadingOption(String desc, int resultIndex) {
        sDescription = desc;
        //mSource = SysConst.mapResult(resultIndex);
        iIndex = resultIndex;
    }

    public final String getDescription() { return sDescription; }
    public final void setDescription(String desc) { sDescription = desc; }

    public final int getIndex(){ return iIndex; }
    public final void setIndex(int id){ iIndex = id; }

    public final boolean getIsResult() { return bIsResult; }
    public final void setIsResult(boolean b) { bIsResult = b; }
    //public final SysConst.MappedIndex getSource() { return mSource; }
    //public final void setSource(SysConst.MappedIndex source, boolean isResult) {
    //    mSource = source;
    //    bIsResult = isResult;
    //}
    //public final void setSource(int index, boolean isResult) {
    //    this.iIndex = index;
    //    this.bIsResult = isResult;
    //}
    public final boolean getContinuous() { return bContinuous; }
    public final void setContinuous(boolean cont) { bContinuous = cont; }

    public final boolean getAutoScale() { return bAutoScale; }
    public final void setAutoScale(boolean auto) { bAutoScale = auto; }

    public final double getPercentBelow() { return dPercentBelow; }
    public final void setPercentBelow(double perc) { dPercentBelow = perc; }

    public final double getPercentAbove() { return dPercentAbove; }
    public final void setPercentAbove(double perc) { dPercentAbove = perc; }

    public double getStartValue() { return dStart; }
    public void setStartValue(double start) { dStart = start; }

    public double getEndValue() { return dEnd; }
    public void setEndValue(double end) { dEnd = end; }

    public double getBinSize() { return (dEnd - dStart) / 4; }
    public void setBinSize(double bin) { dEnd = dStart + 4 * bin; }

    public void copyFrom(ShadingOption source) {
        this.sDescription  = source.sDescription;
        //this.mSource       = (SysConst.MappedIndex)source.mSource.clone();
        this.iIndex        = source.iIndex;
        this.bIsResult     = source.bIsResult;
        this.bContinuous   = source.bContinuous;
        this.bAutoScale    = source.bAutoScale;
        this.dPercentBelow = source.dPercentBelow;
        this.dPercentAbove = source.dPercentAbove;
        this.dStart        = source.dStart;
        this.dEnd          = source.dEnd;
    }
}